package com.esri.core.geodatabase;

import com.esri.core.ags.LayerServiceInfo;
import com.esri.core.geometry.Envelope;
import com.esri.core.geometry.Geometry;
import com.esri.core.geometry.GeometryEngine;
import com.esri.core.geometry.SpatialReference;
import com.esri.core.internal.tasks.e;
import com.esri.core.internal.tasks.f.c;
import com.esri.core.internal.util.LocalGDBUtil;
import com.esri.core.internal.util.d;
import com.esri.core.internal.util.g;
import com.esri.core.map.AttachmentInfo;
import com.esri.core.map.CallbackListener;
import com.esri.core.map.DrawingInfo;
import com.esri.core.map.EditFieldsInfo;
import com.esri.core.map.EditInfo;
import com.esri.core.map.Feature;
import com.esri.core.map.FeatureResult;
import com.esri.core.map.FeatureTemplate;
import com.esri.core.map.FeatureType;
import com.esri.core.map.Field;
import com.esri.core.map.OwnershipBasedAccessControlForFeatures;
import com.esri.core.renderer.Renderer;
import com.esri.core.symbol.Symbol;
import com.esri.core.table.FeatureTable;
import com.esri.core.table.TableException;
import com.esri.core.tasks.query.QueryParameters;
import com.esri.core.tasks.query.RelatedQueryParameters;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicInteger;
import org.codehaus.jackson.JsonFactory;
import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonToken;
import org.codehaus.jackson.map.MappingJsonFactory;

/* loaded from: classes.dex */
public class GeodatabaseFeatureTable extends FeatureTable {
    private static final String f = "Table does not allow geometry updates.";
    int a;
    Geodatabase b;
    LayerServiceInfo c;
    EditFieldsInfo d;
    List<Relationship> e;

    private long a() {
        return -1L;
    }

    native long nativeAddAttachment(long j, int i, long j2, String str, String str2, String str3);

    native long[] nativeAddFeature(long j, int i, String str) throws TableException;

    native boolean nativeAttachmentsEnabled(long j, int i);

    native boolean nativeCanDelete(long j, int i, long j2);

    native boolean nativeCanUpdate(long j, int i, long j2);

    /* JADX INFO: Access modifiers changed from: package-private */
    public native long[] nativeCheckIDs(long j, int i, long[] jArr);

    native void nativeDeleteAttachment(long j, int i, long j2, long j3);

    native void nativeDeleteRows(long j, int i, long[] jArr);

    native long nativeGetAddCount(long j, int i);

    native String nativeGetAttributes(long j, int i, long j2, String[] strArr);

    native String nativeGetChangedRows(long j, int i, boolean z, long j2);

    native long nativeGetDeleteCount(long j, int i);

    native String nativeGetDeletedRows(long j, int i, boolean z, long j2);

    native double[] nativeGetExtent(long j, int i);

    native byte[] nativeGetGeometry(long j, int i, long j2);

    native String nativeGetGlobalId(long j, int i);

    native String nativeGetInsertedRows(long j, int i, boolean z, long j2);

    native long nativeGetRowCount(long j, int i);

    native String nativeGetRowId(long j, int i);

    /* JADX INFO: Access modifiers changed from: package-private */
    public native String nativeGetSchema(long j, int i);

    native int nativeGetSpatialReference(long j, int i);

    native long nativeGetUpdateCount(long j, int i);

    native boolean nativeIsTable(long j, int i);

    native String nativeQueryAttachmentInfos(long j, int i, long j2);

    native byte[] nativeRetrieveAttachment(long j, int i, long j2, long j3);

    native void nativeRevertChanges(long j, int i);

    native void nativeUpdateAttachment(long j, int i, long j2, long j3, String str, String str2, String str3);

    native void nativeUpdateAttributes(long j, int i, long j2, String str) throws TableException;

    native void nativeUpdateGeometry(long j, int i, long j2, byte[] bArr) throws TableException;

    /* JADX INFO: Access modifiers changed from: package-private */
    public GeodatabaseFeatureTable() {
        this.a = -1;
        this.b = null;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public GeodatabaseFeatureTable(int i, Geodatabase geodatabase) {
        this.a = -1;
        this.b = null;
        this.a = i;
        this.b = geodatabase;
        String nativeGetSchema = nativeGetSchema(getHandle(), this.a);
        JsonFactory jsonFactory = new JsonFactory();
        try {
            JsonParser createJsonParser = jsonFactory.createJsonParser(nativeGetSchema);
            this.c = LayerServiceInfo.fromJson(createJsonParser);
            createJsonParser.close();
            this.d = this.c.getEditFieldsInfo();
            JsonParser createJsonParser2 = jsonFactory.createJsonParser(nativeGetSchema);
            this.e = Relationship.listFromJson(createJsonParser2, geodatabase);
            createJsonParser2.close();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    @Override // com.esri.core.table.FeatureTable
    public long addFeature(Feature feature) throws TableException {
        if (feature == null || getHandle() == 0 || this.a == -1) {
            return -1L;
        }
        try {
            long[] nativeAddFeature = nativeAddFeature(getHandle(), this.a, a(new Feature[]{feature}, true, true));
            if (nativeAddFeature != null) {
                return nativeAddFeature[0];
            }
            return -1L;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    @Override // com.esri.core.table.FeatureTable
    public long[] addFeatures(List<Feature> list) throws TableException {
        if (getHandle() == 0 || this.a == -1) {
            return null;
        }
        try {
            long[] nativeAddFeature = nativeAddFeature(getHandle(), this.a, a((Feature[]) list.toArray(new Feature[0]), true, true));
            if (nativeAddFeature != null) {
                return nativeAddFeature;
            }
            return null;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    @Override // com.esri.core.table.FeatureTable
    public void deleteFeature(long j) throws TableException {
        if (getHandle() == 0 || this.a == -1) {
            return;
        }
        nativeDeleteRows(getHandle(), this.a, new long[]{j});
    }

    @Override // com.esri.core.table.FeatureTable
    public void deleteFeatures(long[] jArr) throws TableException {
        if (getHandle() == 0 || this.a == -1) {
            return;
        }
        nativeDeleteRows(getHandle(), this.a, jArr);
    }

    public void updateFeature(long j, Map<String, Object> map) throws TableException {
        updateFeature(j, new GeodatabaseFeature(map, null, this));
    }

    public void updateFeature(long j, Geometry geometry) throws TableException {
        updateFeature(j, new GeodatabaseFeature(null, geometry, this));
    }

    public void updateFeature(long j, Map<String, Object> map, Geometry geometry) throws TableException {
        updateFeature(j, new GeodatabaseFeature(map, geometry, this));
    }

    @Override // com.esri.core.table.FeatureTable
    public void updateFeature(long j, Feature feature) throws TableException {
        if (getHandle() == 0 || this.a == -1) {
            return;
        }
        if (feature.getGeometry() != null) {
            testAllowGeometryUpdates();
            nativeUpdateGeometry(getHandle(), this.a, j, GeometryEngine.geometryToEsriShape(feature.getGeometry()));
        }
        try {
            nativeUpdateAttributes(getHandle(), this.a, j, a(new Feature[]{feature}, false, true));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    @Override // com.esri.core.table.FeatureTable
    public void updateFeatures(long[] jArr, List<Feature> list) throws TableException {
        if (getHandle() == 0 || this.a == -1) {
            return;
        }
        for (int i = 0; i != jArr.length; i++) {
            Geometry geometry = list.get(i).getGeometry();
            if (geometry != null) {
                testAllowGeometryUpdates();
                nativeUpdateGeometry(getHandle(), this.a, jArr[i], GeometryEngine.geometryToEsriShape(geometry));
            }
            try {
                nativeUpdateAttributes(getHandle(), this.a, jArr[i], a(new Feature[]{list.get(i)}, false, true));
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    }

    @Override // com.esri.core.table.FeatureTable
    public Feature getFeature(long j) throws TableException {
        return getFeature(j, null);
    }

    public Feature getFeature(long j, SpatialReference spatialReference) throws TableException {
        return a(j, spatialReference, (List<Field>) null);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public Feature a(long j, SpatialReference spatialReference, List<Field> list) throws TableException {
        Geometry geometry;
        if (getHandle() == 0 || this.a == -1) {
            return null;
        }
        byte[] nativeGetGeometry = nativeGetGeometry(getHandle(), this.a, j);
        if (nativeGetGeometry != null) {
            Geometry geometryFromEsriShape = GeometryEngine.geometryFromEsriShape(nativeGetGeometry, Geometry.Type.UNKNOWN);
            if (spatialReference != null) {
                geometryFromEsriShape = GeometryEngine.project(geometryFromEsriShape, getSpatialReference(), spatialReference);
            }
            geometry = geometryFromEsriShape;
        } else {
            geometry = null;
        }
        ArrayList arrayList = new ArrayList();
        if (list != null) {
            for (Field field : list) {
                arrayList.add(field.getName());
            }
        }
        Map<String, Object> a2 = d.a(nativeGetAttributes(getHandle(), this.a, j, arrayList.isEmpty() ? null : (String[]) arrayList.toArray(new String[arrayList.size()])));
        if (a2.isEmpty() && geometry == null) {
            return null;
        }
        return new GeodatabaseFeature(j, a2, geometry, this);
    }

    public boolean checkFeatureExists(long j) {
        return getFeatures(new long[]{j}).iterator().hasNext();
    }

    @Override // com.esri.core.table.FeatureTable
    public FeatureResult getFeatures(long[] jArr) {
        if (getHandle() == 0 || this.a == -1) {
            return null;
        }
        return new b(this, jArr, null, getDisplayField(), getObjectIdField(), getFields());
    }

    public long addAttachment(long j, File file, String str, String str2) throws FileNotFoundException, IOException {
        if (getHandle() == 0 || this.a == -1) {
            return -1L;
        }
        if (str == null || str.trim().isEmpty()) {
            throw new IllegalArgumentException("Content type cannot be null or empty.");
        }
        if (file == null) {
            throw new IllegalArgumentException("File cannot be null.");
        }
        if (!file.exists()) {
            throw new FileNotFoundException("File cannot be found.");
        }
        try {
            long handle = getGeodatabase().getHandle();
            int i = this.a;
            String absolutePath = file.getAbsolutePath();
            if (str2 == null) {
                str2 = file.getName();
            }
            return nativeAddAttachment(handle, i, j, absolutePath, str, str2);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    public Future<Long> addAttachment(final long j, final File file, final String str, final String str2, final CallbackListener<Long> callbackListener) throws FileNotFoundException {
        if (getHandle() == 0 || this.a == -1) {
            return null;
        }
        if (str == null || str.trim().isEmpty()) {
            throw new IllegalArgumentException("Content type cannot be null or empty.");
        }
        if (file == null) {
            throw new IllegalArgumentException("File cannot be null.");
        }
        if (!file.exists()) {
            throw new FileNotFoundException("File cannot be found.");
        }
        return e.b.submit(new Callable<Long>() { // from class: com.esri.core.geodatabase.GeodatabaseFeatureTable.1
            @Override // java.util.concurrent.Callable
            /* renamed from: a */
            public Long call() throws Exception {
                long j2;
                try {
                    GeodatabaseFeatureTable geodatabaseFeatureTable = GeodatabaseFeatureTable.this;
                    long handle = geodatabaseFeatureTable.getGeodatabase().getHandle();
                    int i = GeodatabaseFeatureTable.this.a;
                    long j3 = j;
                    String absolutePath = file.getAbsolutePath();
                    String str3 = str;
                    String str4 = str2;
                    if (str4 == null) {
                        str4 = file.getName();
                    }
                    j2 = geodatabaseFeatureTable.nativeAddAttachment(handle, i, j3, absolutePath, str3, str4);
                } catch (Exception e) {
                    CallbackListener callbackListener2 = callbackListener;
                    if (callbackListener2 != null) {
                        callbackListener2.onError(e);
                    }
                    j2 = -1;
                }
                Long valueOf = Long.valueOf(j2);
                CallbackListener callbackListener3 = callbackListener;
                if (callbackListener3 != null) {
                    callbackListener3.onCallback(valueOf);
                }
                return valueOf;
            }
        });
    }

    public void updateAttachment(long j, long j2, File file, String str, String str2) throws FileNotFoundException, IOException {
        if (getHandle() == 0 || this.a == -1) {
            return;
        }
        if (str != null && str.trim().isEmpty()) {
            throw new IllegalArgumentException("Content type cannot be empty.");
        }
        if (str2 != null && str2.trim().isEmpty()) {
            throw new IllegalArgumentException("File name cannot be empty.");
        }
        if (file != null && !file.exists()) {
            throw new FileNotFoundException("File cannot be found.");
        }
        nativeUpdateAttachment(getGeodatabase().getHandle(), this.a, j, j2, file == null ? null : file.getAbsolutePath(), str, str2);
    }

    public Future<Void> updateAttachment(final long j, final long j2, final File file, final String str, final String str2, final CallbackListener<Void> callbackListener) throws FileNotFoundException, IOException {
        if (getHandle() == 0 || this.a == -1) {
            return null;
        }
        if (str != null && str.trim().isEmpty()) {
            throw new IllegalArgumentException("Content type cannot be empty.");
        }
        if (str2 != null && str2.trim().isEmpty()) {
            throw new IllegalArgumentException("File name cannot be empty.");
        }
        if (file != null && !file.exists()) {
            throw new FileNotFoundException("File cannot be found.");
        }
        return e.b.submit(new Callable<Void>() { // from class: com.esri.core.geodatabase.GeodatabaseFeatureTable.3
            @Override // java.util.concurrent.Callable
            /* renamed from: a */
            public Void call() throws Exception {
                try {
                    GeodatabaseFeatureTable geodatabaseFeatureTable = GeodatabaseFeatureTable.this;
                    long handle = geodatabaseFeatureTable.getGeodatabase().getHandle();
                    int i = GeodatabaseFeatureTable.this.a;
                    long j3 = j;
                    long j4 = j2;
                    File file2 = file;
                    geodatabaseFeatureTable.nativeUpdateAttachment(handle, i, j3, j4, file2 == null ? null : file2.getAbsolutePath(), str, str2);
                } catch (Exception e) {
                    CallbackListener callbackListener2 = callbackListener;
                    if (callbackListener2 != null) {
                        callbackListener2.onError(e);
                    }
                }
                CallbackListener callbackListener3 = callbackListener;
                if (callbackListener3 != null) {
                    callbackListener3.onCallback(null);
                }
                return null;
            }
        });
    }

    public void deleteAttachment(long j, long j2) {
        if (getHandle() == 0 || this.a == -1) {
            return;
        }
        nativeDeleteAttachment(getGeodatabase().getHandle(), this.a, j, j2);
    }

    public Future<Void> deleteAttachment(final long j, final long j2, final CallbackListener<Void> callbackListener) {
        if (getHandle() == 0 || this.a == -1) {
            return null;
        }
        return e.b.submit(new Callable<Void>() { // from class: com.esri.core.geodatabase.GeodatabaseFeatureTable.4
            @Override // java.util.concurrent.Callable
            /* renamed from: a */
            public Void call() throws Exception {
                try {
                    GeodatabaseFeatureTable geodatabaseFeatureTable = GeodatabaseFeatureTable.this;
                    geodatabaseFeatureTable.nativeDeleteAttachment(geodatabaseFeatureTable.getGeodatabase().getHandle(), GeodatabaseFeatureTable.this.a, j, j2);
                } catch (Exception e) {
                    CallbackListener callbackListener2 = callbackListener;
                    if (callbackListener2 != null) {
                        callbackListener2.onError(e);
                    }
                }
                CallbackListener callbackListener3 = callbackListener;
                if (callbackListener3 != null) {
                    callbackListener3.onCallback(null);
                }
                return null;
            }
        });
    }

    public Future<Void> deleteAttachments(final long j, final long[] jArr, final CallbackListener<Void> callbackListener) {
        if (getHandle() == 0 || this.a == -1) {
            return null;
        }
        return e.b.submit(new Callable<Void>() { // from class: com.esri.core.geodatabase.GeodatabaseFeatureTable.5
            @Override // java.util.concurrent.Callable
            /* renamed from: a */
            public Void call() throws Exception {
                long[] jArr2;
                try {
                    for (long j2 : jArr) {
                        if (Thread.currentThread().isInterrupted()) {
                            break;
                        }
                        GeodatabaseFeatureTable geodatabaseFeatureTable = GeodatabaseFeatureTable.this;
                        geodatabaseFeatureTable.nativeDeleteAttachment(geodatabaseFeatureTable.getGeodatabase().getHandle(), GeodatabaseFeatureTable.this.a, j, j2);
                    }
                } catch (Exception e) {
                    CallbackListener callbackListener2 = callbackListener;
                    if (callbackListener2 != null) {
                        callbackListener2.onError(e);
                    }
                }
                CallbackListener callbackListener3 = callbackListener;
                if (callbackListener3 != null) {
                    callbackListener3.onCallback(null);
                }
                return null;
            }
        });
    }

    public Future<InputStream> retrieveAttachment(final long j, final long j2, final CallbackListener<InputStream> callbackListener) {
        if (getHandle() == 0 || this.a == -1) {
            return null;
        }
        return e.b.submit(new Callable<InputStream>() { // from class: com.esri.core.geodatabase.GeodatabaseFeatureTable.6
            @Override // java.util.concurrent.Callable
            /* renamed from: a */
            public InputStream call() throws Exception {
                try {
                    ByteArrayInputStream retrieveAttachment = GeodatabaseFeatureTable.this.retrieveAttachment(j, j2);
                    CallbackListener callbackListener2 = callbackListener;
                    if (callbackListener2 != null) {
                        callbackListener2.onCallback(retrieveAttachment);
                    }
                    return retrieveAttachment;
                } catch (Exception e) {
                    CallbackListener callbackListener3 = callbackListener;
                    if (callbackListener3 != null) {
                        callbackListener3.onError(e);
                        return null;
                    }
                    throw e;
                }
            }
        });
    }

    /* JADX INFO: Access modifiers changed from: protected */
    public ByteArrayInputStream retrieveAttachment(long j, long j2) {
        byte[] nativeRetrieveAttachment = nativeRetrieveAttachment(getGeodatabase().getHandle(), this.a, j, j2);
        if (nativeRetrieveAttachment != null) {
            return new ByteArrayInputStream(nativeRetrieveAttachment);
        }
        return null;
    }

    public GeodatabaseFeature createFeatureWithTemplate(FeatureTemplate featureTemplate, Geometry geometry) throws TableException {
        if (featureTemplate == null || featureTemplate.getPrototype() == null) {
            return null;
        }
        return new GeodatabaseFeature(featureTemplate.getPrototype(), geometry, this);
    }

    public GeodatabaseFeature createFeatureWithType(FeatureType featureType, Geometry geometry) throws TableException {
        if (featureType.getTemplates().length > 0) {
            return new GeodatabaseFeature(featureType.getTemplates()[0].getPrototype(), geometry, this);
        }
        return null;
    }

    public GeodatabaseFeature createNewFeature() throws TableException {
        return new GeodatabaseFeature(null, null, this);
    }

    public GeodatabaseFeature createNewFeature(Map<String, Object> map, Geometry geometry) throws TableException {
        return new GeodatabaseFeature(map, geometry, this);
    }

    public String getCapabilities() {
        LayerServiceInfo layerServiceInfo = this.c;
        if (layerServiceInfo == null) {
            return null;
        }
        return layerServiceInfo.getCapabilities().toString();
    }

    public String getDefaultDefinitionExpression() {
        LayerServiceInfo layerServiceInfo = this.c;
        if (layerServiceInfo == null) {
            return null;
        }
        return layerServiceInfo.getDefinitionExpression();
    }

    public String getDisplayField() {
        LayerServiceInfo layerServiceInfo = this.c;
        if (layerServiceInfo == null) {
            return null;
        }
        return layerServiceInfo.getDisplayField();
    }

    public List<Field> getEditableAttributeFields() {
        Field[] fields;
        if (this.c != null) {
            ArrayList arrayList = new ArrayList();
            for (Field field : this.c.getFields()) {
                if (field.isEditable()) {
                    arrayList.add(field);
                }
            }
            return arrayList;
        }
        return null;
    }

    @Override // com.esri.core.table.FeatureTable
    public String getCopyright() {
        LayerServiceInfo layerServiceInfo = this.c;
        if (layerServiceInfo != null) {
            return layerServiceInfo.getCopyrightText();
        }
        return null;
    }

    public String getDescription() {
        LayerServiceInfo layerServiceInfo = this.c;
        if (layerServiceInfo != null) {
            return layerServiceInfo.getDescription();
        }
        return null;
    }

    public EditFieldsInfo getEditFieldsInfo() {
        LayerServiceInfo layerServiceInfo = this.c;
        if (layerServiceInfo == null) {
            return null;
        }
        return layerServiceInfo.getEditFieldsInfo();
    }

    public EditInfo getEditInfo(GeodatabaseFeature geodatabaseFeature, EditInfo.ACTION_TYPE action_type) {
        String str;
        long a2;
        if (this.c == null || this.d == null) {
            return null;
        }
        if (AnonymousClass2.a[action_type.ordinal()] == 1) {
            str = this.d.getEditorField() != null ? (String) geodatabaseFeature.getAttributeValue(this.d.getEditorField()) : null;
            if (this.d.getEditDateField() != null) {
                a2 = com.esri.core.internal.util.b.a(geodatabaseFeature.getAttributeValue(this.d.getEditDateField()));
            }
            a2 = Long.MIN_VALUE;
        } else {
            str = this.d.getCreatorField() != null ? (String) geodatabaseFeature.getAttributeValue(this.d.getCreatorField()) : null;
            if (this.d.getCreationDateField() != null) {
                a2 = com.esri.core.internal.util.b.a(geodatabaseFeature.getAttributeValue(this.d.getCreationDateField()));
            }
            a2 = Long.MIN_VALUE;
        }
        if ((str == null || str.length() == 0) && a2 == Long.MIN_VALUE) {
            return null;
        }
        return new EditInfo(str, a2, action_type);
    }

    /* renamed from: com.esri.core.geodatabase.GeodatabaseFeatureTable$2  reason: invalid class name */
    /* loaded from: classes.dex */
    static /* synthetic */ class AnonymousClass2 {
        static final /* synthetic */ int[] a;

        static {
            int[] iArr = new int[EditInfo.ACTION_TYPE.values().length];
            a = iArr;
            try {
                iArr[EditInfo.ACTION_TYPE.EDIT.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                a[EditInfo.ACTION_TYPE.CREATION.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
        }
    }

    public String getGlobalIdField() {
        if (getHandle() == 0 || this.a == -1) {
            return null;
        }
        return nativeGetGlobalId(getGeodatabase().getHandle(), this.a);
    }

    public int getFeatureServiceLayerId() {
        LayerServiceInfo layerServiceInfo = this.c;
        if (layerServiceInfo == null) {
            return -1;
        }
        return layerServiceInfo.getId();
    }

    public String getFeatureServiceLayerName() {
        LayerServiceInfo layerServiceInfo = this.c;
        if (layerServiceInfo == null) {
            return null;
        }
        return layerServiceInfo.getName();
    }

    public Geometry.Type getGeometryType() {
        LayerServiceInfo layerServiceInfo = this.c;
        if (layerServiceInfo == null) {
            return Geometry.Type.UNKNOWN;
        }
        return layerServiceInfo.getGeometryType();
    }

    @Override // com.esri.core.table.FeatureTable
    public long getNumberOfFeatures() {
        if (getHandle() == 0 || this.a == -1) {
            return -1L;
        }
        return nativeGetRowCount(getGeodatabase().getHandle(), this.a);
    }

    public String getObjectIdField() {
        if (getHandle() == 0 || this.a == -1) {
            return null;
        }
        return nativeGetRowId(getGeodatabase().getHandle(), this.a);
    }

    public OwnershipBasedAccessControlForFeatures getOwnershipBasedAccessControlForFeatures() {
        LayerServiceInfo layerServiceInfo = this.c;
        if (layerServiceInfo == null) {
            return null;
        }
        return layerServiceInfo.getOwnershipBasedAccessControlForFeatures();
    }

    @Override // com.esri.core.table.FeatureTable
    public SpatialReference getSpatialReference() {
        int nativeGetSpatialReference;
        if (getHandle() == 0 || (nativeGetSpatialReference = nativeGetSpatialReference(getHandle(), this.a)) <= 0) {
            return null;
        }
        return SpatialReference.create(nativeGetSpatialReference);
    }

    public List<Relationship> getRelationships() {
        return this.e;
    }

    public List<FeatureTemplate> getFeatureTemplates() {
        LayerServiceInfo layerServiceInfo = this.c;
        if (layerServiceInfo != null) {
            return layerServiceInfo.getTemplates();
        }
        return null;
    }

    public FeatureType getFeatureType(String str) {
        LayerServiceInfo layerServiceInfo = this.c;
        if (layerServiceInfo == null) {
            return null;
        }
        return layerServiceInfo.getSubType(str);
    }

    public String getTypeIdField() {
        LayerServiceInfo layerServiceInfo = this.c;
        if (layerServiceInfo == null) {
            return null;
        }
        return layerServiceInfo.getTypeIdField();
    }

    public List<FeatureType> getFeatureTypes() {
        LayerServiceInfo layerServiceInfo = this.c;
        if (layerServiceInfo == null) {
            return null;
        }
        return Arrays.asList(layerServiceInfo.getSubTypes());
    }

    public boolean hasAttachments() {
        if (getHandle() == 0 || this.a == -1) {
            return false;
        }
        return nativeAttachmentsEnabled(getHandle(), this.a);
    }

    public boolean isAllowGeometryUpdates() {
        return canUpdateGeometry();
    }

    @Override // com.esri.core.table.FeatureTable
    public boolean isEditable() {
        LayerServiceInfo layerServiceInfo = this.c;
        if (layerServiceInfo == null) {
            return false;
        }
        return layerServiceInfo.getCapabilities().toString().toLowerCase().contains("editing");
    }

    public boolean canCreate() {
        LayerServiceInfo layerServiceInfo = this.c;
        if (layerServiceInfo == null) {
            return false;
        }
        return layerServiceInfo.getCapabilities().isCreateSupported();
    }

    public boolean canUpdate(long j) {
        if (getHandle() == 0 || this.a == -1 || !canUpdate()) {
            return false;
        }
        return nativeCanUpdate(getHandle(), this.a, j);
    }

    public boolean canUpdate() {
        LayerServiceInfo layerServiceInfo = this.c;
        if (layerServiceInfo == null) {
            return false;
        }
        return layerServiceInfo.getCapabilities().isUpdateSupported();
    }

    public boolean canDelete(long j) {
        if (getHandle() == 0 || this.a == -1 || !canDelete()) {
            return false;
        }
        return nativeCanDelete(getHandle(), this.a, j);
    }

    public boolean canDelete() {
        LayerServiceInfo layerServiceInfo = this.c;
        if (layerServiceInfo == null) {
            return false;
        }
        return layerServiceInfo.getCapabilities().isDeleteSupported();
    }

    public boolean canUpdateGeometry() {
        LayerServiceInfo layerServiceInfo = this.c;
        if (layerServiceInfo == null) {
            return false;
        }
        return layerServiceInfo.isAllowGeometryUpdates();
    }

    public Future<List<AttachmentInfo>> queryAttachmentInfos(final long j, final CallbackListener<List<AttachmentInfo>> callbackListener) {
        if (getHandle() == 0 || this.a == -1) {
            return null;
        }
        return e.b.submit(new Callable<List<AttachmentInfo>>() { // from class: com.esri.core.geodatabase.GeodatabaseFeatureTable.7
            @Override // java.util.concurrent.Callable
            /* renamed from: a */
            public List<AttachmentInfo> call() throws Exception {
                ArrayList arrayList = new ArrayList();
                try {
                    List<AttachmentInfo> queryAttachmentInfos = GeodatabaseFeatureTable.this.queryAttachmentInfos(j);
                    if (queryAttachmentInfos != null) {
                        arrayList = queryAttachmentInfos;
                    }
                    CallbackListener callbackListener2 = callbackListener;
                    if (callbackListener2 != null) {
                        callbackListener2.onCallback(arrayList);
                    }
                    return queryAttachmentInfos;
                } catch (Exception e) {
                    CallbackListener callbackListener3 = callbackListener;
                    if (callbackListener3 != null) {
                        callbackListener3.onError(e);
                        callbackListener.onCallback(arrayList);
                        return arrayList;
                    }
                    throw e;
                }
            }
        });
    }

    /* JADX INFO: Access modifiers changed from: protected */
    public List<AttachmentInfo> queryAttachmentInfos(long j) throws JsonParseException, IOException, Exception {
        String nativeQueryAttachmentInfos = nativeQueryAttachmentInfos(getGeodatabase().getHandle(), this.a, j);
        ArrayList arrayList = null;
        if (nativeQueryAttachmentInfos != null) {
            JsonParser c = d.c(nativeQueryAttachmentInfos);
            if (c.getCurrentToken() != null ? c.getCurrentToken() != JsonToken.START_ARRAY : c.nextToken() != JsonToken.START_ARRAY) {
                return null;
            }
            arrayList = new ArrayList();
            while (c.nextToken() != JsonToken.END_ARRAY) {
                arrayList.add(AttachmentInfo.fromJson(c));
            }
        }
        return arrayList;
    }

    @Override // com.esri.core.table.FeatureTable
    public String getTableName() {
        LayerServiceInfo layerServiceInfo = this.c;
        if (layerServiceInfo != null) {
            return layerServiceInfo.getName();
        }
        return null;
    }

    private String a(Feature[] featureArr, boolean z, boolean z2) throws Exception {
        StringBuilder sb = new StringBuilder();
        if (z2) {
            sb.append("{ \"features\": ");
        }
        sb.append('[');
        boolean z3 = true;
        for (Feature feature : featureArr) {
            if (feature != null) {
                if (z3) {
                    String a2 = a(feature, getSpatialReference(), z);
                    if (a2 != null) {
                        sb.append(a2);
                        z3 = false;
                    }
                } else {
                    String a3 = a(feature, getSpatialReference(), z);
                    if (a3 != null) {
                        sb.append(',');
                        sb.append(a3);
                    }
                }
            }
        }
        sb.append(']');
        if (z2) {
            sb.append("}");
        }
        return sb.toString();
    }

    private static String a(Feature feature, SpatialReference spatialReference, boolean z) throws Exception {
        StringWriter stringWriter = new StringWriter();
        JsonGenerator createJsonGenerator = new MappingJsonFactory().createJsonGenerator(stringWriter);
        createJsonGenerator.writeStartObject();
        if (!feature.getAttributes().isEmpty()) {
            Map<String, Object> attributes = feature.getAttributes();
            createJsonGenerator.writeFieldName("attributes");
            createJsonGenerator.writeRawValue(d.a(attributes));
        }
        if (feature.getGeometry() != null && z) {
            createJsonGenerator.writeFieldName("geometry");
            createJsonGenerator.writeRawValue(GeometryEngine.geometryToJson(spatialReference, feature.getGeometry()));
        }
        createJsonGenerator.writeEndObject();
        createJsonGenerator.close();
        return stringWriter.getBuffer().toString();
    }

    /* JADX INFO: Access modifiers changed from: protected */
    public long getHandle() {
        return this.b.getHandle();
    }

    public void clearEdits() {
        if (getHandle() == 0 || this.a == -1) {
            return;
        }
        nativeRevertChanges(getGeodatabase().getHandle(), this.a);
    }

    public List<Feature> getAddedFeatures() {
        String nativeGetInsertedRows;
        if (getHandle() == 0 || this.a == -1 || (nativeGetInsertedRows = nativeGetInsertedRows(getHandle(), this.a, true, a())) == null) {
            return null;
        }
        return a(nativeGetInsertedRows);
    }

    public List<Feature> getDeletedFeatures() {
        String nativeGetDeletedRows;
        if (getHandle() == 0 || this.a == -1 || (nativeGetDeletedRows = nativeGetDeletedRows(getHandle(), this.a, true, a())) == null) {
            return null;
        }
        return a(nativeGetDeletedRows);
    }

    public List<Feature> getUpdatedFeatures() {
        String nativeGetChangedRows;
        if (getHandle() == 0 || this.a == -1 || (nativeGetChangedRows = nativeGetChangedRows(getHandle(), this.a, true, a())) == null) {
            return null;
        }
        return a(nativeGetChangedRows);
    }

    public long getAddedFeaturesCount() {
        return nativeGetAddCount(getHandle(), this.a);
    }

    public long getUpdatedFeaturesCount() {
        return nativeGetUpdateCount(getHandle(), this.a);
    }

    public long getDeletedFeaturesCount() {
        return nativeGetDeleteCount(getHandle(), this.a);
    }

    @Override // com.esri.core.table.FeatureTable
    public Field getField(String str) {
        LayerServiceInfo layerServiceInfo = this.c;
        if (layerServiceInfo != null) {
            return layerServiceInfo.getField(str.toLowerCase());
        }
        return null;
    }

    @Override // com.esri.core.table.FeatureTable
    public List<Field> getFields() {
        LayerServiceInfo layerServiceInfo = this.c;
        if (layerServiceInfo != null) {
            return Arrays.asList(layerServiceInfo.getFields());
        }
        return null;
    }

    @Override // com.esri.core.table.FeatureTable
    public boolean hasGeometry() {
        return !nativeIsTable(getHandle(), this.a);
    }

    public Geodatabase getGeodatabase() {
        return this.b;
    }

    @Override // com.esri.core.table.FeatureTable
    public Envelope getExtent() {
        double[] nativeGetExtent;
        if (getHandle() == 0 || this.a == -1 || (nativeGetExtent = nativeGetExtent(getHandle(), this.a)) == null || nativeGetExtent.length != 4) {
            return null;
        }
        return new Envelope(nativeGetExtent[0], nativeGetExtent[1], nativeGetExtent[2], nativeGetExtent[3]);
    }

    @Override // com.esri.core.table.FeatureTable
    public Future<FeatureResult> queryFeatures(final QueryParameters queryParameters, final CallbackListener<FeatureResult> callbackListener) {
        checkOutFields(queryParameters);
        return e.b.submit(new Callable<FeatureResult>() { // from class: com.esri.core.geodatabase.GeodatabaseFeatureTable.8
            @Override // java.util.concurrent.Callable
            /* renamed from: a */
            public FeatureResult call() throws Exception {
                try {
                    try {
                        if (Thread.currentThread().isInterrupted()) {
                            throw new InterruptedException();
                        }
                        FeatureResult queryFeaturesInner = GeodatabaseFeatureTable.this.queryFeaturesInner(queryParameters);
                        CallbackListener callbackListener2 = callbackListener;
                        if (callbackListener2 != null) {
                            callbackListener2.onCallback(queryFeaturesInner);
                        }
                        return queryFeaturesInner;
                    } catch (Exception e) {
                        CallbackListener callbackListener3 = callbackListener;
                        if (callbackListener3 != null) {
                            callbackListener3.onError(e);
                        }
                        throw e;
                    }
                } catch (Throwable th) {
                    CallbackListener callbackListener4 = callbackListener;
                    if (callbackListener4 != null) {
                        callbackListener4.onCallback(null);
                    }
                    throw th;
                }
            }
        });
    }

    /* JADX INFO: Access modifiers changed from: protected */
    public FeatureResult queryFeaturesInner(QueryParameters queryParameters) throws Exception {
        if (isAggregateQuery(queryParameters)) {
            return a(queryParameters);
        }
        return b(queryParameters);
    }

    /* JADX INFO: Access modifiers changed from: protected */
    public boolean isAggregateQuery(QueryParameters queryParameters) {
        return (queryParameters == null || queryParameters.getOutStatistics() == null || queryParameters.getOutStatistics().length <= 0) ? false : true;
    }

    private FeatureResult a(QueryParameters queryParameters) throws Exception {
        return c.a(LocalGDBUtil.nativeQueryAggregate(getHandle(), this.a, queryParameters.toJSON()));
    }

    private FeatureResult b(QueryParameters queryParameters) {
        return new b(this, LocalGDBUtil.nativeQueryIds(getHandle(), this.a, queryParameters.toJSON()), queryParameters.getOutSpatialReference(), getDisplayField(), getObjectIdField(), a(queryParameters.getOutFields()));
    }

    private List<Field> a(String[] strArr) {
        List<Field> fields = getFields();
        if (fields == null || fields.isEmpty() || strArr == null || strArr.length == 0) {
            return fields;
        }
        List asList = Arrays.asList(strArr);
        if (asList.contains("*")) {
            return fields;
        }
        ArrayList arrayList = new ArrayList();
        for (Field field : fields) {
            if (asList.contains(field.getName())) {
                arrayList.add(field);
            }
        }
        return arrayList;
    }

    /* JADX INFO: Access modifiers changed from: protected */
    public void checkOutFields(QueryParameters queryParameters) {
        if (queryParameters != null) {
            String[] outFields = queryParameters.getOutFields();
            if (outFields == null || outFields.length == 0) {
                queryParameters.setOutFields(new String[]{"*"});
                return;
            }
            ArrayList arrayList = new ArrayList();
            for (String str : outFields) {
                arrayList.add(str.trim());
            }
            String objectIdField = getObjectIdField();
            if (g.b(objectIdField) && !arrayList.contains(objectIdField) && !arrayList.contains("*")) {
                arrayList.add(objectIdField);
            }
            queryParameters.setOutFields((String[]) arrayList.toArray(new String[0]));
        }
    }

    @Override // com.esri.core.table.FeatureTable
    public Future<long[]> queryIds(final QueryParameters queryParameters, final CallbackListener<long[]> callbackListener) {
        return e.b.submit(new Callable<long[]>() { // from class: com.esri.core.geodatabase.GeodatabaseFeatureTable.9
            @Override // java.util.concurrent.Callable
            /* renamed from: a */
            public long[] call() throws Exception {
                try {
                    try {
                        if (Thread.currentThread().isInterrupted()) {
                            throw new InterruptedException();
                        }
                        long[] nativeQueryIds = LocalGDBUtil.nativeQueryIds(GeodatabaseFeatureTable.this.getHandle(), GeodatabaseFeatureTable.this.a, queryParameters.toJSON());
                        CallbackListener callbackListener2 = callbackListener;
                        if (callbackListener2 != null) {
                            callbackListener2.onCallback(nativeQueryIds);
                        }
                        return nativeQueryIds;
                    } catch (Exception e) {
                        CallbackListener callbackListener3 = callbackListener;
                        if (callbackListener3 != null) {
                            callbackListener3.onError(e);
                        }
                        throw e;
                    }
                } catch (Throwable th) {
                    CallbackListener callbackListener4 = callbackListener;
                    if (callbackListener4 != null) {
                        callbackListener4.onCallback(null);
                    }
                    throw th;
                }
            }
        });
    }

    public Future<Map<Long, FeatureResult>> queryRelated(final RelatedQueryParameters relatedQueryParameters, final CallbackListener<Map<Long, FeatureResult>> callbackListener) {
        return e.b.submit(new Callable<Map<Long, FeatureResult>>() { // from class: com.esri.core.geodatabase.GeodatabaseFeatureTable.10
            @Override // java.util.concurrent.Callable
            /* renamed from: a */
            public Map<Long, FeatureResult> call() throws Exception {
                try {
                    try {
                        Map<Long, FeatureResult> queryRelatedLocal = GeodatabaseFeatureTable.this.queryRelatedLocal(relatedQueryParameters);
                        CallbackListener callbackListener2 = callbackListener;
                        if (callbackListener2 != null) {
                            callbackListener2.onCallback(queryRelatedLocal);
                        }
                        return queryRelatedLocal;
                    } catch (Exception e) {
                        Map map = Collections.EMPTY_MAP;
                        CallbackListener callbackListener3 = callbackListener;
                        if (callbackListener3 != null) {
                            callbackListener3.onError(e);
                        }
                        throw e;
                    }
                } catch (Throwable th) {
                    CallbackListener callbackListener4 = callbackListener;
                    if (callbackListener4 != null) {
                        callbackListener4.onCallback(null);
                    }
                    throw th;
                }
            }
        });
    }

    /* JADX INFO: Access modifiers changed from: protected */
    public Relationship getRelationship(int i) {
        if (getRelationships() != null) {
            for (Relationship relationship : getRelationships()) {
                if (relationship.getId() == i) {
                    return relationship;
                }
            }
            return null;
        }
        return null;
    }

    protected Map<Long, FeatureResult> queryRelatedLocal(RelatedQueryParameters relatedQueryParameters) {
        Relationship relationship = getRelationship(relatedQueryParameters.getRelationshipId());
        if (relationship == null) {
            throw new RuntimeException("Relationship ID does not exist.");
        }
        Map<Long, FeatureResult> a2 = a(LocalGDBUtil.nativeRelatedQueryIds(getHandle(), this.a, relatedQueryParameters.toJSON()), relationship.getRelatedTable(), relatedQueryParameters.getOutSpatialReference());
        return a2 == null ? Collections.EMPTY_MAP : a2;
    }

    @Override // com.esri.core.table.FeatureTable
    public String toString() {
        return "GeodatabaseFeatureTable [Name=" + getTableName() + ", ID=" + getFeatureServiceLayerId() + ", geodatabase=" + this.b + "]";
    }

    public int hashCode() {
        Geodatabase geodatabase = this.b;
        return (((geodatabase == null ? 0 : geodatabase.hashCode()) + 31) * 31) + this.a;
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj != null && getClass() == obj.getClass()) {
            GeodatabaseFeatureTable geodatabaseFeatureTable = (GeodatabaseFeatureTable) obj;
            Geodatabase geodatabase = this.b;
            if (geodatabase == null) {
                if (geodatabaseFeatureTable.b != null) {
                    return false;
                }
            } else if (!geodatabase.equals(geodatabaseFeatureTable.b)) {
                return false;
            }
            return this.a == geodatabaseFeatureTable.a;
        }
        return false;
    }

    public LayerServiceInfo getLayerServiceInfo() {
        return this.c;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public Symbol a(Feature feature) {
        Renderer renderer;
        DrawingInfo drawingInfo = this.c.getDrawingInfo();
        if (drawingInfo == null || (renderer = drawingInfo.getRenderer()) == null) {
            return null;
        }
        return renderer.getSymbol(feature);
    }

    private List<Feature> a(String str) {
        ArrayList arrayList = new ArrayList();
        try {
            JsonParser c = d.c(str);
            if (d.c(c)) {
                while (c.getCurrentToken() != JsonToken.END_OBJECT) {
                    String currentName = c.getCurrentName();
                    c.nextToken();
                    if ("features" == currentName && c.getCurrentToken() == JsonToken.START_ARRAY) {
                        while (c.nextToken() != JsonToken.END_ARRAY) {
                            Feature a2 = a(c);
                            if (a2 != null) {
                                arrayList.add(a2);
                            }
                        }
                    }
                }
                return arrayList;
            }
            return null;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    private Feature a(JsonParser jsonParser) {
        if (jsonParser.getCurrentToken() != JsonToken.START_OBJECT) {
            return null;
        }
        Map<String, Object> map = null;
        Geometry geometry = null;
        while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
            try {
                String currentName = jsonParser.getCurrentName();
                jsonParser.nextToken();
                if ("geometry".equals(currentName)) {
                    geometry = d.d(jsonParser);
                } else if ("attributes".equals(currentName)) {
                    map = d.a(jsonParser);
                } else {
                    jsonParser.skipChildren();
                }
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
        if (map != null) {
            long j = -1;
            Object obj = map.get(getObjectIdField());
            if (obj != null) {
                if (obj instanceof Integer) {
                    j = ((Integer) obj).intValue();
                } else if (obj instanceof Long) {
                    j = ((Long) obj).longValue();
                }
            }
            return new GeodatabaseFeature(j, map, geometry, this);
        }
        return null;
    }

    private Map<Long, FeatureResult> a(String str, GeodatabaseFeatureTable geodatabaseFeatureTable, SpatialReference spatialReference) {
        HashMap hashMap = new HashMap();
        try {
            JsonParser c = d.c(str);
            if (d.c(c)) {
                while (c.nextToken() != JsonToken.END_OBJECT) {
                    String currentName = c.getCurrentName();
                    c.nextToken();
                    if ("relatedRecordGroups".equals(currentName)) {
                        if (c.getCurrentToken() == JsonToken.START_ARRAY) {
                            while (c.nextToken() != JsonToken.END_ARRAY) {
                                Long l = -1L;
                                ArrayList arrayList = new ArrayList();
                                while (c.nextToken() != JsonToken.END_OBJECT) {
                                    String currentName2 = c.getCurrentName();
                                    c.nextToken();
                                    if ("objectId".equals(currentName2)) {
                                        l = Long.valueOf(c.getLongValue());
                                    } else if ("relatedRecords".equals(currentName2)) {
                                        if (c.getCurrentToken() == JsonToken.START_ARRAY) {
                                            while (c.nextToken() != JsonToken.END_ARRAY) {
                                                arrayList.add(Long.valueOf(c.getLongValue()));
                                            }
                                        } else {
                                            c.skipChildren();
                                        }
                                    }
                                }
                                if (l.longValue() != -1) {
                                    long[] jArr = new long[arrayList.size()];
                                    int i = 0;
                                    Iterator it = arrayList.iterator();
                                    while (it.hasNext()) {
                                        jArr[i] = ((Long) it.next()).longValue();
                                        i++;
                                    }
                                    hashMap.put(l, new b(geodatabaseFeatureTable, jArr, spatialReference, geodatabaseFeatureTable.getDisplayField(), geodatabaseFeatureTable.getObjectIdField(), geodatabaseFeatureTable.getFields()));
                                }
                            }
                        } else {
                            c.skipChildren();
                        }
                    }
                }
                return hashMap;
            }
            return null;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    protected void testAllowGeometryUpdates() throws TableException {
        if (!isAllowGeometryUpdates()) {
            throw new TableException(f);
        }
    }

    /* loaded from: classes.dex */
    class a implements Iterator<Object> {
        private final long[] b;
        private final AtomicInteger c = new AtomicInteger(0);
        private final GeodatabaseFeatureTable d;
        private final SpatialReference e;
        private final List<Field> f;

        public a(GeodatabaseFeatureTable geodatabaseFeatureTable, long[] jArr, SpatialReference spatialReference, List<Field> list) {
            if (geodatabaseFeatureTable == null) {
                throw new RuntimeException("table cannot be null");
            }
            if (jArr == null) {
                throw new RuntimeException("oids cannot be null");
            }
            this.b = GeodatabaseFeatureTable.this.nativeCheckIDs(GeodatabaseFeatureTable.this.getHandle(), geodatabaseFeatureTable.a, jArr);
            this.d = geodatabaseFeatureTable;
            this.e = spatialReference;
            this.f = list;
        }

        public int a() {
            return this.b.length;
        }

        @Override // java.util.Iterator
        public boolean hasNext() {
            return this.c.get() < a();
        }

        @Override // java.util.Iterator
        /* renamed from: b */
        public Feature next() {
            try {
                Feature a = this.d.a(this.b[this.c.get()], this.e, this.f);
                this.c.incrementAndGet();
                return a;
            } catch (TableException e) {
                throw new RuntimeException(e);
            } catch (ArrayIndexOutOfBoundsException unused) {
                throw new NoSuchElementException();
            }
        }

        @Override // java.util.Iterator
        public void remove() {
            throw new UnsupportedOperationException();
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public class b extends FeatureResult {
        long[] a;
        SpatialReference b;
        GeodatabaseFeatureTable c;

        /* JADX INFO: Access modifiers changed from: package-private */
        public b(GeodatabaseFeatureTable geodatabaseFeatureTable, long[] jArr, SpatialReference spatialReference, String str, String str2, List<Field> list) {
            this.a = null;
            this.b = null;
            this.c = null;
            this.a = jArr == null ? new long[0] : jArr;
            this.b = spatialReference;
            this.c = geodatabaseFeatureTable;
            setDisplayFieldName(str);
            setObjectIdFieldName(str2);
            setFields(list);
        }

        @Override // com.esri.core.map.FeatureResult, java.lang.Iterable
        public Iterator<Object> iterator() {
            return new a(this.c, this.a, this.b, getFields());
        }

        @Override // com.esri.core.map.FeatureResult
        public long featureCount() {
            return this.a.length;
        }
    }
}
